//
//  @ Project : Galaxy Star Trading System
//  @ File Name : DefaultProvider.h
//  @ Date : 2014/9/5
//  @ Author :
//
//


#if !defined(_CDEFAULTPROVIDER_H_H)
#define _CDEFAULTPROVIDER_H_H

namespace GSTrader
{
	namespace TradeBase
	{
		class TRADE_BASE_API CDefaultCommissionProvider : public CCommissionProvider
		{
		public:
			CDefaultCommissionProvider(int nType);
			virtual ~CDefaultCommissionProvider();

			virtual double CalcCommission(CInstrument& inst, CCommissionRate* pCommissionRate, double dPrice, double dVol, int nOpenClose);

		private:
			double CalcStockCommission(CInstrument& inst, CCommissionRate* pCommissionRate, double dPrice, double dVol, int nOpenClose);
			double CalcFutureCommission(CInstrument& inst, CCommissionRate* pCommissionRate, double dPrice, double dVol, int nOpenClose);
			double CalcOptionCommission(CInstrument& inst, CCommissionRate* pCommissionRate, double dPrice, double dVol, int nOpenClose);
		};

		class TRADE_BASE_API CDefaultMarginProvider : public CMarginProvider
		{
		public:
			CDefaultMarginProvider(int nType);
			virtual ~CDefaultMarginProvider();

			virtual double CalcMargin(CInstrument& inst);
		};

		class TRADE_BASE_API CDefaultSlippageProvider : public CSlippageProvider
		{
		public:
			CDefaultSlippageProvider(int nType);
			virtual ~CDefaultSlippageProvider();

			virtual double GetPrice(CTrade& trade);
		};
	}
}

#endif // _CDEFAULTPROVIDER_H_H
